package com.ruoyi.db.sms.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 团购规则对象 sms_groupon_rules
 *
 * @author yfy
 * @date 2020-04-21
 */

@ApiModel("团购规则实体类")
@Data
@EqualsAndHashCode(callSuper=true)
public class SmsGrouponRules extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("团购规则ID")
    private Long id;

    @ApiModelProperty("商品ID")
    @Excel(name = "商品ID")
    @NotBlank(message = "商品ID不能为空")
    private Long goodsId;

    @ApiModelProperty("商品名称")
    @Excel(name = "商品名称")
    @NotBlank(message = "商品名称不能为空")
    @Size(min = 0, max = 127, message = "商品名称长度不能超过127个字符")
    private String goodsName;

    @ApiModelProperty("商品或商品货品图片")
    @Excel(name = "商品或商品货品图片")
    @Size(min = 0, max = 255, message = "商品或商品货品图片长度不能超过255个字符")
    private String picUrl;

    @ApiModelProperty("优惠金额")
    @Excel(name = "优惠金额")
    @NotBlank(message = "优惠金额不能为空")
    private BigDecimal discount;

    @ApiModelProperty("达到优惠条件的人数")
    @Excel(name = "达到优惠条件的人数")
    @NotBlank(message = "达到优惠条件的人数不能为空")
    private Integer discountMember;

    @ApiModelProperty("团购过期时间")
    @Excel(name = "团购过期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime expireTime;

    @ApiModelProperty("团购规则状态（0为正常上线 1为到期自动下线 2为管理手动下线）")
    @Excel(name = "团购规则状态", readConverterExp = "0=为正常上线,1=为到期自动下线,2=为管理手动下线")
    private Integer status;

    @ApiModelProperty("创建时间")
    private LocalDateTime addTime;

    @ApiModelProperty("逻辑删除")
    private Integer deleted;

}
